﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CacheAttribute.Attributes
{
    /// <summary>
    /// 缓存删除Attributes
    /// 功能
    /// 1.删除正则匹配到的缓存
    /// 2.删除指定名字的缓存
    /// 两者只能取一种
    /// </summary>
    [AttributeUsage(validOn:AttributeTargets.Method,AllowMultiple =false,Inherited =true)]
    public class CacheDelAttribute:Attribute
    {
        /// <summary>
        /// 比配一个正则删除缓存
        /// </summary>
        public string Regex { get; set; }

        public string ExactCache { get; set; }

        public bool work { get; set; }

        public CacheDelAttribute(string regex, string exactCache, bool work)
        {
            Regex = regex;
            ExactCache = exactCache;
            this.work = work;
        }
    }
}
